<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单列表</title>
	<include file="Public:header" />
	<style type="text/css">
		.input{width:190px; border:1px solid #ccc; padding:2px;}
		.select{width:190px; border:1px solid #ccc; height:25px; padding:2px; margin:-5px auto;}
	</style>
	<script type="text/javascript">
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		//alert(actflg);
		function delete_todo()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要删除的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$.messager.confirm('询问', '确认要删除选中的项吗？', function(r){
					if (r){
						//todo...
						window.location.href="{:U('Order/data_del')}"+actflg+"id="+selChk+"";
					}
				});
			}
		}
		
		function data_status_to_y()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要启用的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$.messager.confirm('询问', '确认要启用选中的项吗？', function(r){
					if (r){
						//todo...
						window.location.href="{:U('Order/data_status_to_y')}"+actflg+"id="+selChk+"";
					}
				});
			}
		}
		
		function data_status_to_y2()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要处理的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$.messager.confirm('询问', '确认要启用处理的项吗？', function(r){
					if (r){
						//todo...
						window.location.href="{:U('Order/data_status_to_y2')}"+actflg+"id="+selChk+"";
					}
				});
			}
		}
		
		function data_status_to_n()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";			
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要禁用的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$.messager.confirm('询问', '确认要禁用选中的项吗？', function(r){
					if (r){
						//todo...
						window.location.href="{:U('Order/data_status_to_n')}"+actflg+"id="+selChk+"";
					}
				});
			}
		}
		
		
		function selectall_todo()
		{
			$("input[name='chk_list']").attr("checked",true);
		}
		function selectall_undo()
		{
			$("input[name='chk_list']").attr("checked",false);
		}
	</script>
</head>
<body class="">
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div>订单列表</div>
		<div style="text-align:left;">
		<form id="frm_search" method="post" action="{:U('Order/data_list')}" style="margin:10px auto 0px 25px;">
		<div style="float:left; margin:0px; padding:2px;">
		<select id="stat" name="stat" class="easyui-combobox" editable="false" style="width:60px;">
								<option value=''>全部</option>
								<option value='0'>未支付</option>
								<option value='1'>已支付</option>
								<option value='2'>已处理</option>
		</select>
		</div>
		<script type="text/javascript">$("#stat").attr("value","{$stat}");</script>
		 订单号或备注 <input type="text" id="keywords" name="keywords" class="input" value="{$keywords}" />
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-search" onclick="$('#frm_search').submit();">搜索</a>
		<a href="{:U('Order/data_list')}" class="easyui-linkbutton" iconCls="icon-reload">显示所有</a>
		</form>
		</div>
	</div>
	<div class=" space-out-10px">
	
	<div class="list-title">
		<div class="list-t-l w50px"></div>
		<div class="list-t-l w60px">ID</div>
		<div class="list-t-l w150px">订单号</div>
		<div class="list-t-l w100px">订单时间</div>
		<div class="list-t-l w50px">会员ID</div>
		<div class="list-t-l w100px">会员名</div>
		<div class="list-t-l w60px">金额</div>
		<div class="list-t-l w200px">备注</div>
		<div class="list-t-l w50px">状态</div>
		<div class="list-t-r"></div>
	</div>
	
	<div class="list-box">
	<volist name="datalist" id="datalist">
	<div class="list-body">
		<div class="list-t-l w50px"><input type="checkbox" name="chk_list" value="{$datalist.id}" style="margin-top:6px;" /></div>
		<div class="list-t-l w60px">{$datalist.id}</div>
		<div class="list-t-l w150px">{$datalist.order_id}</div>
		<div class="list-t-l w100px">{$datalist.create_time|date='Y-m-d h:i:s',###}</div>
		<div class="list-t-l w50px">{$datalist.user_id}</div>
		<div class="list-t-l w100px">{$datalist.username}</div>
		<div class="list-t-l w60px">￥{$datalist.total_fee}</div>
		<php>
		$remarkarr=unserialize($datalist['remark']);		
		if(is_array($remarkarr['content']))
		{
			foreach($remarkarr['content'] as $row)
			{
				$content.=$row['title'].' ';
			}
		}else{
			$content=$remarkarr['content'];
		}
		</php>
		<div class="list-t-l w200px" alt="<php>echo $remarkarr['title'].'('.$content.')';</php>" title="<php>echo $remarkarr['title'].'('.$content.')';</php>"><php>echo $remarkarr['title'].'('.$content.')';</php></div>
		<div class="list-t-l w50px"><if condition="$datalist['status_flg'] eq '0'"><font color="#cccccc">未支付</font></if>
		<if condition="$datalist['status_flg'] eq '1'"><font color="#009955">已支付</font></if>
		<if condition="$datalist['status_flg'] eq '2'"><font color="#005599">已处理</font></if>
		</div>
	</div>
	</volist>
	</div>
	
	<div class="list-title">
		<div class="list-t-l">操作：<a href="javascript:;" onclick="selectall_todo()">全选</a> - <a href="javascript:;" onclick="selectall_undo()">取消选择</a>
		- <a href="javascript:;" onclick="delete_todo()">删除</a>
		- <a href="javascript:;" onclick="data_status_to_y()">设置为已支付</a>
		- <a href="javascript:;" onclick="data_status_to_n()">设置为未支付</a>
		- <a href="javascript:;" onclick="data_status_to_y2()">设置为已处理</a>
		</div>
		<div class="list-t-r"></div>
	</div>
	
	</div>
	
	<div class="demo-info space-out-5px">
	<div class="demo-tip icon-tip"></div>
	<div class="pages">&nbsp;{$page}</div>
	</div>
</body>
</html>
